package com.example.client.mapper;

import com.example.client.domain.Address;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AddressMapper {

    @Select("select * from adresss where username=#{username}")
    public List<Address> selectAddressesByUserName(String username);

    @Update("update adresss set address=#{address} where address_id=#{address_id}")
    public void updateAddressByAddressId(String address, Integer address_id);

    @Insert("insert into adresss (username, address) VALUES (#{username}, #{address})")
    public void insertAddress(String address, String username);

    @Delete("delete from adresss where address_id=#{address_id}")
    public void deleteAddressByAddressId(Integer address_id);
}
